<template>
  <div class="inputk">
    <section class="tip_text_container">
      <div class="tip_icon">
        <span></span>
        <span></span>
      </div>
      <input style="border: 1px solid lavender" v-model="UUidValue" type="text" id="deviceUuid"/>
      <div class="confrim" @click="setDeviceUUid()">设置UUID</div>
    </section>
  </div>
</template>

<script>
  import {mapMutations, mapState} from 'vuex'
  export default {
    name: 'Inputk',
    props: ['alertText', 'LeftText', 'RightText'],
    data () {
      return {
        msg: 'Welcome to Your Vue.js App',
        UUidValue: ''
      }
    },
    computed: {
      ...mapState([
        'Duuid'
      ])
    },
    methods: {
      ...mapMutations(['SETUUID'
      ]),
      setDeviceUUid () {
        this.SETUUID({duuid:this.UUidValue})
        alert('设置成功')
        this.$emit('closeTip')
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .inputk{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background-color: rgba(255,255,255,0.8);
  }
  .tip_text_container{
    position: absolute;
    width: 90%;
    bottom: 30px;
    left: 5%;
    border: 1px;
    animation: tipMove .4s ;
    border-radius: 0.7rem;
    display: flex;
    padding: 0 1.6rem 1.6rem;
    background-color: rgba(255,255,255,0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }
  .tip_text{
    color: black;
    font-size: 0.4rem;
    font-weight: bold;
    line-height: 0.8rem;
    padding: 20px 0;
  }
  @media screen and (min-width: 320px) {
    .cancel{
      padding: 0.2rem  2rem;
      float: left;
      border-radius: 0.5rem;
      border: 1px solid #eee;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
      background: #f7f7f7!important;
    }
    .confrim{
      padding: 0.2rem  2rem;
      float: left;
      border: 1px solid #eee;
      border-radius: 0.5rem;
      margin-left: 10px;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
      background: #f7f7f7!important;
    }
  }
  @media screen and (max-width: 320px) {
    .cancel{
      padding: 0.2rem  2rem;
      float: left;
      border-radius: 0.5rem;
      border: 1px solid #eee;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
      background: #f7f7f7!important;
    }
    .confrim{
      padding: 0.2rem  2rem;
      float: left;
      border: 1px solid #eee;
      border-radius: 0.5rem;
      margin-left: 10px;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
      background: #f7f7f7!important;
    }
  }

</style>
